this.dash.showAppsButton);
this._searchController.connect('notify::search-active', this._onSearchChanged.bind(this));
- this._thumbnailsBox =
- new WorkspaceThumbnail.ThumbnailsBox(this._workspaceAdjustment);
+ this._thumbnailsBox = new WorkspaceThumbnail.ThumbnailsBox(
+ this._workspaceAdjustment, Main.layoutManager.primaryIndex);
this._thumbnailsBox.connect('notify::should-show', () => {
this._thumbnailsBox.show();
this._thumbnailsBox.ease_property('expand-fraction',
0, 1, 0),
},
}, class WorkspaceThumbnail extends St.Widget {
- _init(metaWorkspace) {
+ _init(metaWorkspace, monitorIndex) {
super._init({
clip_to_allocation: true,
style_class: 'workspace-thumbnail',
this._delegate = this;
this.metaWorkspace = metaWorkspace;
- this.monitorIndex = Main.layoutManager.primaryIndex;
+ this.monitorIndex = monitorIndex;
this._removed = false;
true),
},
}, class ThumbnailsBox extends St.Widget {
- _init(scrollAdjustment) {
+ _init(scrollAdjustment, monitorIndex) {
super._init({
style_class: 'workspace-thumbnails',
reactive: true,
this._indicator = indicator;
this.add_actor(indicator);
+ this._monitorIndex = monitorIndex;
+
this._dropWorkspace = -1;
this._dropPlaceholderPos = -1;
this._dropPlaceholder = new St.Bin({ style_class: 'placeholder' });
for (let k = start; k < start + count; k++) {
let metaWorkspace = workspaceManager.get_workspace_by_index(k);
- let thumbnail = new WorkspaceThumbnail(metaWorkspace);
+ let thumbnail = new WorkspaceThumbnail(metaWorkspace, this._monitorIndex);
thumbnail.setPorthole(this._porthole.x, this._porthole.y,
this._porthole.width, this._porthole.height);
this._thumbnails.push(thumbnail);
}
_updatePorthole() {
- if (!Main.layoutManager.primaryMonitor) {
- this._porthole = { width: global.stage.width, height: global.stage.height,
- x: global.stage.x, y: global.stage.y };
+ if (!Main.layoutManager.monitors[this._monitorIndex]) {
+ const { x, y, width, height } = global.stage;
+ this._porthole = { x, y, width, height };
} else {
- this._porthole = Main.layoutManager.getWorkAreaForMonitor(Main.layoutManager.primaryIndex);
+ this._porthole =
+ Main.layoutManager.getWorkAreaForMonitor(this._monitorIndex);
}
this.queue_relayout();